Completed
Push — master ( e9e0b4...cbda97 )
by J.D.
03:49
created
src/classes/entity/restriction/view/post/content/password/protected.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * @since 2.2.0
29 29
 	 */
30
-	public function __construct( $entity_id, array $hierarchy ) {
30
+	public function __construct($entity_id, array $hierarchy) {
31 31
 
32
-		if ( $entity_id ) {
32
+		if ($entity_id) {
33 33
 
34
-			$post = get_post( $entity_id );
34
+			$post = get_post($entity_id);
35 35
 
36
-			if ( $post && $post->post_password ) {
36
+			if ($post && $post->post_password) {
37 37
 				$this->has_password = true;
38 38
 			}
39 39
 		}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * @since 2.2.0
44 44
 	 */
45
-	public function user_can( $user_id ) {
45
+	public function user_can($user_id) {
46 46
 		return ! $this->has_password;
47 47
 	}
48 48
 
Please login to merge, or discard this patch.
src/classes/entity/restriction/comment/post/status/nonpublic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
 	 */
21 21
 	protected function get_post_id() {
22 22
 
23
-		$comment = get_comment( $this->entity_id );
23
+		$comment = get_comment($this->entity_id);
24 24
 
25
-		if ( $comment ) {
25
+		if ($comment) {
26 26
 			return $comment->comment_post_ID;
27 27
 		}
28 28
 
Please login to merge, or discard this patch.
src/classes/entity/restriction/unregistered.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@
 block discarded – undo
30 30
 	/**
31 31
 	 * @since 2.2.0
32 32
 	 */
33
-	public function __construct( $entity_id, array $hierarchy ) {
34
-		$this->is_registered = wordpoints_entities()->is_registered( $hierarchy[0] );
33
+	public function __construct($entity_id, array $hierarchy) {
34
+		$this->is_registered = wordpoints_entities()->is_registered($hierarchy[0]);
35 35
 	}
36 36
 
37 37
 	/**
38 38
 	 * @since 2.2.0
39 39
 	 */
40
-	public function user_can( $user_id ) {
40
+	public function user_can($user_id) {
41 41
 		return $this->is_registered;
42 42
 	}
43 43
 
Please login to merge, or discard this patch.
src/classes/entity/comment.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 	/**
30 30
 	 * @since 2.1.0
31 31
 	 */
32
-	protected function get_entity( $id ) {
32
+	protected function get_entity($id) {
33 33
 
34 34
 		// We must do this because the $id parameter is expected by reference.
35
-		$comment = get_comment( $id );
35
+		$comment = get_comment($id);
36 36
 
37
-		if ( ! $comment ) {
37
+		if ( ! $comment) {
38 38
 			return false;
39 39
 		}
40 40
 
@@ -44,30 +44,30 @@  discard block
 block discarded – undo
44 44
 	/**
45 45
 	 * @since 2.1.0
46 46
 	 */
47
-	protected function get_entity_human_id( $entity ) {
48
-		return get_comment_excerpt( $entity->comment_ID );
47
+	protected function get_entity_human_id($entity) {
48
+		return get_comment_excerpt($entity->comment_ID);
49 49
 	}
50 50
 
51 51
 	/**
52 52
 	 * @since 2.1.0
53 53
 	 */
54 54
 	public function get_title() {
55
-		return __( 'Comment', 'wordpoints' );
55
+		return __('Comment', 'wordpoints');
56 56
 	}
57 57
 
58 58
 	/**
59 59
 	 * @since 2.1.0
60 60
 	 * @deprecated 2.2.0 Use entity restrictions API instead.
61 61
 	 */
62
-	public function user_can_view( $user_id, $id ) {
62
+	public function user_can_view($user_id, $id) {
63 63
 
64
-		_deprecated_function( __METHOD__, '2.2.0' );
64
+		_deprecated_function(__METHOD__, '2.2.0');
65 65
 
66 66
 		/** @var WordPoints_Entity_Restrictions $restrictions */
67
-		$restrictions = wordpoints_entities()->get_sub_app( 'restrictions' );
68
-		$restriction = $restrictions->get( $id, $this->get_slug(), 'view' );
67
+		$restrictions = wordpoints_entities()->get_sub_app('restrictions');
68
+		$restriction = $restrictions->get($id, $this->get_slug(), 'view');
69 69
 
70
-		return $restriction->user_can( $user_id );
70
+		return $restriction->user_can($user_id);
71 71
 	}
72 72
 }
73 73
 
Please login to merge, or discard this patch.
src/classes/entity/restricted/visibilityi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	 *
30 30
 	 * @return bool Whether the user can view the entity.
31 31
 	 */
32
-	public function user_can_view( $user_id, $id );
32
+	public function user_can_view($user_id, $id);
33 33
 }
34 34
 
35 35
 // EOF
Please login to merge, or discard this patch.
src/classes/entity/hierarchyi.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 *
34 34
 	 * @param WordPoints_Entity $entity An entity.
35 35
 	 */
36
-	public function add_entity( WordPoints_Entity $entity );
36
+	public function add_entity(WordPoints_Entity $entity);
37 37
 
38 38
 	/**
39 39
 	 * Remove an entity from the top of the hierarchy.
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 *
43 43
 	 * @param string $slug The slug of the entity to remove.
44 44
 	 */
45
-	public function remove_entity( $slug );
45
+	public function remove_entity($slug);
46 46
 
47 47
 	/**
48 48
 	 * Descend to a child of the current entity/entity child.
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return bool Whether the descent was successful.
55 55
 	 */
56
-	public function descend( $child_slug );
56
+	public function descend($child_slug);
57 57
 
58 58
 	/**
59 59
 	 * Ascend to the parent of the current entity/entity child.
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 *
83 83
 	 * @return WordPoints_EntityishI|null The entity/child, or null if not found.
84 84
 	 */
85
-	public function get_from_hierarchy( array $hierarchy );
85
+	public function get_from_hierarchy(array $hierarchy);
86 86
 }
87 87
 
88 88
 // EOF
Please login to merge, or discard this patch.
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -32,6 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @since 2.1.0
33 33
 	 *
34 34
 	 * @param WordPoints_Entity $entity An entity.
35
+	 * @return void
35 36
 	 */
36 37
 	public function add_entity( WordPoints_Entity $entity );
37 38
 
@@ -41,6 +42,7 @@  discard block
 block discarded – undo
41 42
 	 * @since 2.1.0
42 43
 	 *
43 44
 	 * @param string $slug The slug of the entity to remove.
45
+	 * @return void
44 46
 	 */
45 47
 	public function remove_entity( $slug );
46 48
 
Please login to merge, or discard this patch.
src/classes/entity/relationship/dynamic.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 	/**
18 18
 	 * @since 2.1.0
19 19
 	 */
20
-	public function __construct( $slug ) {
20
+	public function __construct($slug) {
21 21
 
22
-		parent::__construct( $slug );
22
+		parent::__construct($slug);
23 23
 
24
-		$parts = wordpoints_parse_dynamic_slug( $this->slug );
24
+		$parts = wordpoints_parse_dynamic_slug($this->slug);
25 25
 
26
-		if ( $parts['dynamic'] ) {
26
+		if ($parts['dynamic']) {
27 27
 
28
-			$parsed = $this->parse_slug( $this->related_entity_slug );
28
+			$parsed = $this->parse_slug($this->related_entity_slug);
29 29
 
30 30
 			$this->primary_entity_slug = "{$this->primary_entity_slug}\\{$parts['dynamic']}";
31 31
 			$this->related_entity_slug = "{$parsed['slug']}\\{$parts['dynamic']}";
32 32
 
33
-			if ( $parsed['is_array'] ) {
33
+			if ($parsed['is_array']) {
34 34
 				$this->related_entity_slug .= '{}';
35 35
 			}
36 36
 		}
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function get_title() {
43 43
 
44
-		$parsed = $this->parse_slug( $this->related_entity_slug );
44
+		$parsed = $this->parse_slug($this->related_entity_slug);
45 45
 
46
-		$entity = wordpoints_entities()->get( $parsed['slug'] );
46
+		$entity = wordpoints_entities()->get($parsed['slug']);
47 47
 
48
-		if ( $entity instanceof WordPoints_Entity ) {
48
+		if ($entity instanceof WordPoints_Entity) {
49 49
 			return $entity->get_title();
50 50
 		} else {
51 51
 			return $this->related_entity_slug;
Please login to merge, or discard this patch.
src/classes/entity/attr.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @return mixed The attribute value.
41 41
 	 */
42
-	abstract protected function get_attr_value_from_entity( WordPoints_Entity $entity );
42
+	abstract protected function get_attr_value_from_entity(WordPoints_Entity $entity);
43 43
 
44 44
 	/**
45 45
 	 * Get the data type of this attribute's values.
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	 *
67 67
 	 * @return bool Whether the value was set correctly.
68 68
 	 */
69
-	public function set_the_value_from_entity( WordPoints_Entity $entity ) {
69
+	public function set_the_value_from_entity(WordPoints_Entity $entity) {
70 70
 
71
-		$this->the_value = $this->get_attr_value_from_entity( $entity );
71
+		$this->the_value = $this->get_attr_value_from_entity($entity);
72 72
 
73 73
 		return true;
74 74
 	}
Please login to merge, or discard this patch.
src/classes/entity/childi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 	 *
24 24
 	 * @return bool Whether the value was set successfully.
25 25
 	 */
26
-	public function set_the_value_from_entity( WordPoints_Entity $entity );
26
+	public function set_the_value_from_entity(WordPoints_Entity $entity);
27 27
 }
28 28
 
29 29
 // EOF
Please login to merge, or discard this patch.