Completed
Push — master ( dfda39...6a8025 )
by Uni
06:40
created
src/UK/DynamicProperties/ExplicitGetterSetter.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 
11
-declare( strict_types = 1 );
11
+declare(strict_types = 1);
12 12
 
13 13
 
14 14
 namespace UK\DynamicProperties;
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
     * @param  mixed  $value   The value to set.
52 52
     * @throws \LogicException Is thrown if the property does not exist or if writing is requested but not allowed.
53 53
     */
54
-   public function __set( string $name, $value )
54
+   public function __set(string $name, $value)
55 55
    {
56 56
 
57
-      if ( ! $this->hasWritableProperty( $name, $setterName ) )
57
+      if ( ! $this->hasWritableProperty($name, $setterName))
58 58
       {
59
-         throw new \LogicException( 'No such property: ' . __CLASS__ . '::$' . $name. '!' );
59
+         throw new \LogicException('No such property: '.__CLASS__.'::$'.$name.'!');
60 60
       }
61 61
 
62
-      $this->$setterName( $value );
62
+      $this->$setterName($value);
63 63
 
64 64
    }
65 65
 
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
     * @param  string $name The name of the required property.
70 70
     * @return boolean
71 71
     */
72
-   public function __isset( string $name )
72
+   public function __isset(string $name)
73 73
    {
74 74
 
75
-      if ( $this->hasWritableProperty( $name, $setterName ) )
75
+      if ($this->hasWritableProperty($name, $setterName))
76 76
       {
77 77
          return true;
78 78
       }
79 79
 
80
-      return parent::__isset( $name );
80
+      return parent::__isset($name);
81 81
 
82 82
    }
83 83
 
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
     * @param  string $setterName Returns the name of the associated set method, if method returns TRUE.
89 89
     * @return boolean
90 90
     */
91
-   public function hasWritableProperty( string $name, &$setterName ) : bool
91
+   public function hasWritableProperty(string $name, &$setterName) : bool
92 92
    {
93 93
 
94
-      if ( \in_array( $name, $this->ignoreSetProperties ) )
94
+      if (\in_array($name, $this->ignoreSetProperties))
95 95
       {
96 96
          return false;
97 97
       }
98 98
 
99
-      $setterName = 'set' . \ucfirst( $name );
99
+      $setterName = 'set'.\ucfirst($name);
100 100
 
101
-      return \method_exists( $this, $setterName );
101
+      return \method_exists($this, $setterName);
102 102
 
103 103
    }
104 104
 
Please login to merge, or discard this patch.
src/UK/DynamicProperties/ExplicitGetter.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 
11
-declare( strict_types = 1 );
11
+declare(strict_types = 1);
12 12
 
13 13
 
14 14
 namespace UK\DynamicProperties;
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
     * @return mixed
52 52
     * @throws \LogicException If the property is unknown
53 53
     */
54
-   public function __get( string $name )
54
+   public function __get(string $name)
55 55
    {
56 56
 
57
-      return $this->__internalGet( $name );
57
+      return $this->__internalGet($name);
58 58
 
59 59
    }
60 60
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     * @param  string $name The name of the required property.
65 65
     * @return boolean
66 66
     */
67
-   public function __isset( string $name )
67
+   public function __isset(string $name)
68 68
    {
69 69
 
70
-      return $this->hasReadableProperty( $name, $getterName );
70
+      return $this->hasReadableProperty($name, $getterName);
71 71
 
72 72
    }
73 73
 
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
     * @param  string $getterName Returns the name of the associated get method, if method returns TRUE.
79 79
     * @return boolean
80 80
     */
81
-   public function hasReadableProperty( string $name, &$getterName ) : bool
81
+   public function hasReadableProperty(string $name, &$getterName) : bool
82 82
    {
83 83
 
84
-      if ( \in_array( $name, $this->ignoreGetProperties ) )
84
+      if (\in_array($name, $this->ignoreGetProperties))
85 85
       {
86 86
          return false;
87 87
       }
88 88
 
89
-      $getterName = 'get' . \ucfirst( $name );
89
+      $getterName = 'get'.\ucfirst($name);
90 90
 
91
-      return \method_exists( $this, $getterName );
91
+      return \method_exists($this, $getterName);
92 92
 
93 93
    }
94 94
 
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
     * @param string $name
102 102
     * @return mixed
103 103
     */
104
-   protected function __internalGet( string $name )
104
+   protected function __internalGet(string $name)
105 105
    {
106 106
 
107 107
       // The name of the required getMethod
108
-      if ( ! $this->hasReadableProperty( $name, $getterName ) )
108
+      if ( ! $this->hasReadableProperty($name, $getterName))
109 109
       {
110
-         throw new \LogicException( 'No such property: ' . __CLASS__ . '::$' . $name. '!' );
110
+         throw new \LogicException('No such property: '.__CLASS__.'::$'.$name.'!');
111 111
       }
112 112
 
113 113
       return $this->$getterName();
Please login to merge, or discard this patch.