for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Requires that the current blog has at least one of the listed stickers
*
* @package automattic/jetpack-capabilities
*/
namespace Automattic\Jetpack\Capabilities;
class BlogStickersRule implements Rule {
public function __construct( $stickers ) {
$this->stickers = $stickers;
stickers
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
public function check( ...$args ) {
return has_any_blog_stickers( $this->stickers, get_current_blog_id() ) ?
new PermissionGranted() :
new PermissionDenied(
sprintf( __( 'Missing required blog sticker', 'jetpack' ) )
);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: