| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getPseudoRandomString($length) |
||
| 33 | { |
||
| 34 | $this->validateLength($length); |
||
| 35 | |||
| 36 | $binaryString = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); |
||
| 37 | |||
| 38 | if ($binaryString === false) { |
||
| 39 | throw new InstagramSDKException( |
||
| 40 | static::ERROR_MESSAGE . |
||
| 41 | 'mcrypt_create_iv() returned an error.' |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this->binToHex($binaryString, $length); |
||
| 46 | } |
||
| 48 |