@@ -76,7 +76,7 @@ |
||
| 76 | 76 | * Returns the primary key name(s) for this AR class. |
| 77 | 77 | * This method should be overridden by child classes to define the primary key. |
| 78 | 78 | * |
| 79 | - * @return string[] the primary keys of this record. |
|
| 79 | + * @return string the primary keys of this record. |
|
| 80 | 80 | */ |
| 81 | 81 | public static function primaryKey() |
| 82 | 82 | { |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $this->schema = new Schema(); |
| 93 | 93 | |
| 94 | - if($this->schemaClass !== null){ |
|
| 95 | - if(class_exists($this->schemaClass)){ |
|
| 94 | + if ($this->schemaClass !== null) { |
|
| 95 | + if (class_exists($this->schemaClass)) { |
|
| 96 | 96 | Schema::set(new $this->schemaClass); |
| 97 | 97 | } else { |
| 98 | - throw new InvalidConfigException('"' . $this->schemaClass . '" does not exist.'); |
|
| 98 | + throw new InvalidConfigException('"'.$this->schemaClass.'" does not exist.'); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $dn = $values[self::primaryKey()]; |
| 189 | 189 | unset($values[self::primaryKey()]); |
| 190 | 190 | |
| 191 | - if (($primaryKeys = static::getDb()->execute('ldap_add', [$dn,$values])) === false) { |
|
| 191 | + if (($primaryKeys = static::getDb()->execute('ldap_add', [$dn, $values])) === false) { |
|
| 192 | 192 | return false; |
| 193 | 193 | } |
| 194 | 194 | $this->setAttribute(self::primaryKey(), $dn); |
@@ -189,7 +189,7 @@ |
||
| 189 | 189 | /** |
| 190 | 190 | * Returns the result of the current item. |
| 191 | 191 | * This method is required by the interface [[\Iterator]]. |
| 192 | - * @return integer the index of the current row. |
|
| 192 | + * @return string the index of the current row. |
|
| 193 | 193 | */ |
| 194 | 194 | public function key() |
| 195 | 195 | { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function toArray() |
| 122 | 122 | { |
| 123 | - if($this->_count <= 0){ |
|
| 123 | + if ($this->_count <= 0) { |
|
| 124 | 124 | return []; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | Yii::endProfile('ldap_free_result', 'chrmorandi\ldap\DataReader'); |
| 145 | 145 | |
| 146 | 146 | $this->_result = null; |
| 147 | - $this->_row = null; |
|
| 147 | + $this->_row = null; |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | $resource = $this->_conn->resource; |
| 218 | 218 | |
| 219 | - Yii::beginProfile('current:' . $this->key(), 'chrmorandi\ldap\DataReader'); |
|
| 219 | + Yii::beginProfile('current:'.$this->key(), 'chrmorandi\ldap\DataReader'); |
|
| 220 | 220 | $name = ldap_first_attribute($resource, $this->_row); |
| 221 | 221 | |
| 222 | 222 | while ($name) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param string $dn |
| 112 | 112 | * @param array $entry |
| 113 | 113 | * |
| 114 | - * @return mixed |
|
| 114 | + * @return boolean |
|
| 115 | 115 | */ |
| 116 | 116 | public function modAdd($dn, array $entry) |
| 117 | 117 | { |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @param string $dn |
| 125 | 125 | * @param array $entry |
| 126 | 126 | * |
| 127 | - * @return mixed |
|
| 127 | + * @return boolean |
|
| 128 | 128 | */ |
| 129 | 129 | public function modReplace($dn, array $entry) |
| 130 | 130 | { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param string $dn |
| 138 | 138 | * @param array $entry |
| 139 | 139 | * |
| 140 | - * @return mixed |
|
| 140 | + * @return boolean |
|
| 141 | 141 | */ |
| 142 | 142 | public function modDelete($dn, array $entry) |
| 143 | 143 | { |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * |
| 175 | 175 | * @param $searchResult |
| 176 | 176 | * |
| 177 | - * @return mixed |
|
| 177 | + * @return resource |
|
| 178 | 178 | */ |
| 179 | 179 | public function getFirstEntry($searchResults) |
| 180 | 180 | { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * |
| 187 | 187 | * @param $entry |
| 188 | 188 | * |
| 189 | - * @return mixed |
|
| 189 | + * @return resource |
|
| 190 | 190 | */ |
| 191 | 191 | public function getNextEntry($entry) |
| 192 | 192 | { |
@@ -220,6 +220,7 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | /** |
| 222 | 222 | * {@inheritdoc} |
| 223 | + * @param integer $option |
|
| 223 | 224 | */ |
| 224 | 225 | public function setOption($option, $value) |
| 225 | 226 | { |
@@ -229,10 +230,8 @@ discard block |
||
| 229 | 230 | /** |
| 230 | 231 | * Sets an option on the current connection. |
| 231 | 232 | * |
| 232 | - * @param int $option |
|
| 233 | - * @param mixed $value |
|
| 234 | 233 | * |
| 235 | - * @return mixed |
|
| 234 | + * @return boolean |
|
| 236 | 235 | */ |
| 237 | 236 | public function setRebindCallback(callable $callback) |
| 238 | 237 | { |
@@ -242,7 +241,7 @@ discard block |
||
| 242 | 241 | /** |
| 243 | 242 | * Starts a connection using TLS. |
| 244 | 243 | * |
| 245 | - * @return mixed |
|
| 244 | + * @return boolean |
|
| 246 | 245 | */ |
| 247 | 246 | public function startTLS() |
| 248 | 247 | { |
@@ -253,7 +252,7 @@ discard block |
||
| 253 | 252 | * Returns the error number of the last command |
| 254 | 253 | * executed on the current connection. |
| 255 | 254 | * |
| 256 | - * @return mixed |
|
| 255 | + * @return integer |
|
| 257 | 256 | */ |
| 258 | 257 | public function getErrNo() |
| 259 | 258 | { |
@@ -105,14 +105,14 @@ discard block |
||
| 105 | 105 | return ldap_modify_batch($this->resource, $dn, $values); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Add attribute values to current attributes. |
|
| 110 | - * |
|
| 111 | - * @param string $dn |
|
| 112 | - * @param array $entry |
|
| 113 | - * |
|
| 114 | - * @return mixed |
|
| 115 | - */ |
|
| 108 | + /** |
|
| 109 | + * Add attribute values to current attributes. |
|
| 110 | + * |
|
| 111 | + * @param string $dn |
|
| 112 | + * @param array $entry |
|
| 113 | + * |
|
| 114 | + * @return mixed |
|
| 115 | + */ |
|
| 116 | 116 | public function modAdd($dn, array $entry) |
| 117 | 117 | { |
| 118 | 118 | return ldap_mod_add($this->resource, $dn, $entry); |
@@ -249,12 +249,12 @@ discard block |
||
| 249 | 249 | return ldap_start_tls($this->resource); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Returns the error number of the last command |
|
| 254 | - * executed on the current connection. |
|
| 255 | - * |
|
| 256 | - * @return mixed |
|
| 257 | - */ |
|
| 252 | + /** |
|
| 253 | + * Returns the error number of the last command |
|
| 254 | + * executed on the current connection. |
|
| 255 | + * |
|
| 256 | + * @return mixed |
|
| 257 | + */ |
|
| 258 | 258 | public function getErrNo() |
| 259 | 259 | { |
| 260 | 260 | return ldap_errno($this->resource); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | protected $isEnabled = true; |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * @param LdapConnectionInterface $connection |
|
| 42 | + * @param ConnectionInterface $connection |
|
| 43 | 43 | */ |
| 44 | 44 | public function __construct(ConnectionInterface $connection) |
| 45 | 45 | { |
@@ -339,7 +339,7 @@ |
||
| 339 | 339 | |
| 340 | 340 | /** |
| 341 | 341 | * Sets the SELECT part of the query. |
| 342 | - * @param string|array $columns the columns to be selected. |
|
| 342 | + * @param string $columns the columns to be selected. |
|
| 343 | 343 | * Columns can be specified in either a string (e.g. "id, name") or an array (e.g. ['id', 'name']). |
| 344 | 344 | * |
| 345 | 345 | * ```php |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $filter = (new FilterBuilder)->build($this->where); |
| 111 | - $select = (is_array($this->select))?$this->select:[]; |
|
| 111 | + $select = (is_array($this->select)) ? $this->select : []; |
|
| 112 | 112 | |
| 113 | 113 | $params = [ |
| 114 | 114 | $db->baseDn, |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $params = $command->params; |
| 303 | 303 | $command->setSql($command->db->getQueryBuilder()->selectExists($command->getSql())); |
| 304 | 304 | $command->bindValues($params); |
| 305 | - return (boolean)$command->queryScalar(); |
|
| 305 | + return (boolean) $command->queryScalar(); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | /** |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | </head> |
| 12 | 12 | <body> |
| 13 | 13 | <?php |
| 14 | - // put your code here |
|
| 14 | + // put your code here |
|
| 15 | 15 | |
| 16 | - ?> |
|
| 16 | + ?> |
|
| 17 | 17 | </body> |
| 18 | 18 | </html> |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public $badpasswordtime; |
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * The name that represents an object. |
|
| 85 | - * |
|
| 86 | - * @link https://msdn.microsoft.com/en-us/library/ms675449(v=vs.85).aspx |
|
| 87 | - * |
|
| 88 | - * @var string |
|
| 89 | - */ |
|
| 83 | + /** |
|
| 84 | + * The name that represents an object. |
|
| 85 | + * |
|
| 86 | + * @link https://msdn.microsoft.com/en-us/library/ms675449(v=vs.85).aspx |
|
| 87 | + * |
|
| 88 | + * @var string |
|
| 89 | + */ |
|
| 90 | 90 | public $cn; |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public $contact; |
| 127 | 127 | |
| 128 | - /** |
|
| 129 | - * The entry's country attribute. |
|
| 130 | - * |
|
| 131 | - * @link https://msdn.microsoft.com/en-us/library/ms675432(v=vs.85).aspx |
|
| 132 | - * |
|
| 133 | - * @var string |
|
| 134 | - */ |
|
| 128 | + /** |
|
| 129 | + * The entry's country attribute. |
|
| 130 | + * |
|
| 131 | + * @link https://msdn.microsoft.com/en-us/library/ms675432(v=vs.85).aspx |
|
| 132 | + * |
|
| 133 | + * @var string |
|
| 134 | + */ |
|
| 135 | 135 | public $c; |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public $defaultnamingcontext; |
| 156 | 156 | |
| 157 | - /** |
|
| 158 | - * Contains the name for the department in which the user works. |
|
| 159 | - * |
|
| 160 | - * @link https://msdn.microsoft.com/en-us/library/ms675490(v=vs.85).aspx |
|
| 161 | - * |
|
| 162 | - * @var string |
|
| 163 | - */ |
|
| 157 | + /** |
|
| 158 | + * Contains the name for the department in which the user works. |
|
| 159 | + * |
|
| 160 | + * @link https://msdn.microsoft.com/en-us/library/ms675490(v=vs.85).aspx |
|
| 161 | + * |
|
| 162 | + * @var string |
|
| 163 | + */ |
|
| 164 | 164 | public $department; |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | */ |
| 679 | 679 | public $telephonenumber; |
| 680 | 680 | |
| 681 | - /** |
|
| 681 | + /** |
|
| 682 | 682 | * The users thumbnail photo path. |
| 683 | 683 | * |
| 684 | 684 | * @return string |
@@ -350,11 +350,11 @@ |
||
| 350 | 350 | |
| 351 | 351 | |
| 352 | 352 | |
| 353 | - /** |
|
| 354 | - * Destructor. |
|
| 355 | - * |
|
| 356 | - * Closes the current LDAP connection if it exists. |
|
| 357 | - */ |
|
| 353 | + /** |
|
| 354 | + * Destructor. |
|
| 355 | + * |
|
| 356 | + * Closes the current LDAP connection if it exists. |
|
| 357 | + */ |
|
| 358 | 358 | //public function __destruct(); |
| 359 | 359 | |
| 360 | 360 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | $this->resource = ldap_connect($hostname, $port); |
| 151 | 151 | |
| 152 | - if(!$this->resource){ |
|
| 152 | + if (!$this->resource) { |
|
| 153 | 153 | return false; |
| 154 | 154 | } |
| 155 | 155 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | throw new LdapException($this->getLastError(), $this->getErrNo()); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - if(is_resource($result)){ |
|
| 259 | + if (is_resource($result)) { |
|
| 260 | 260 | return new DataReader($this, $result); |
| 261 | 261 | } |
| 262 | 262 | |