for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Automattic\Jetpack\Capabilities;
use \Automattic\Jetpack\Capabilities;
class Builder {
// public $name;
// public $available;
function __construct() {
$this->capabilities = new Capabilities();
capabilities
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;
}
static function create() {
return new Builder();
function require_wp_role( $wp_role ) {
$this->capabilities->add_rule( new WPRoleRule( $wp_role ) );
return $this;
function require_wp_capability( $wp_capability ) {
$this->capabilities->add_rule( new WPCapabilityRule( $wp_capability ) );
/**
* For traditional Jetpack plans (free, personal, premium, professional ) this
* specifies the minimum plan required in required to perform the action
*/
function require_minimum_jetpack_plan( $jetpack_plan_level ) {
// $this->capabilities->add_rule( new PlanRule( $wp_role ) );
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: