Commit graph

7 commits

Author SHA1 Message Date
Thiemo Kreuz
4b71077646 Remove a few obscure "done" and "empty" comments
These don't add any knowledge to what is already obvious from the
code, I find.

Change-Id: Ia613b6a059f78dbeefdfd020899bd1a6e239a731
2019-01-30 20:35:14 +00:00
David Barratt
be27181956 Add NamespaceRestriction class so that BlockRestriction can handle namespaces.
This begins work on making namespaces a valid restriction type. The CRUD
operations of BlockRestriction can now handle namespaces. Since
NamespaceRestriction implements Restriction, enforcement should start working
immediately, but testing enforcement will come in a subsequent patch since it's
impossible to create them.

Bug: T204991
Change-Id: I7264b452d9ad788c146d6ea25d01d4d7cb5ac4f6
2019-01-21 14:19:39 +00:00
Derick Alangi
78b005d86d block: Avoid use of is_null() PHP function where necessary
WRT performance, is_null() is a few nanoseconds slower than === null
due to function call overhead. Also, I personally think using the
identical check on null is slightly more readable than using is_null().

Change-Id: I83cd7a6ca49acc548a7f46b2c37dfa189889bd19
2019-01-11 16:49:44 +01:00
Thalia
d11e342ed6 Add @since tags to new public methods related to partial blocks
Bug: T210369
Change-Id: I20197ceee8e5e43fac20addc494b841519b915c8
2019-01-08 12:44:33 +00:00
Alangi Derick
262ce14bb6 block: Fix PHPDoc comments to match function signature (or method)
- Add @param annotation for $row to newFromRow() method in Restriction
  interface declaration.
- Remove @param annotation for $option not used in loadByBlockId() method
  signature.

Change-Id: Iec49b9541ea06da9f497e45bd35df26f8124aecf
2018-12-03 10:59:45 +01:00
David Barratt
1087104568
BlockRestriction::update() unnecessarily does a SELECT on the page table.
This unnecessary SELECT causes a performence issue where it takes an
exceedingly long time to perform an update.

Bug: T208526
Change-Id: I0238234146fc838067019351ea97046a7d37d6fc
2018-11-01 15:37:46 -04:00
Dayllan Maza
a562611e5b Add block restriction classes
Partial blocks logic will be used in multiple places. This
classes will group block restriction functionality to avoid
code duplication

Bug: T202036
Change-Id: I675316dddf272fd0d6172ecad3882160752bf780
2018-10-23 17:41:50 -07:00