Error silenced by the at sign (@)

  • Minor
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.silenced_error

  1. $key = "-----BEGIN PRIVATE KEY-----\n".$key.'-----END PRIVATE KEY-----';
  2. $digest = $this->sha512Asn1($this->encodeParameters($parameters));
  3. if (@openssl_private_encrypt($digest, $signature, $key)) {

    Adding "@" before openssl_private_encrypt($digest, $signature, $key) prevents warning and errors during this function execution from being displayed.
    If you need to do that, you should probably implement a better way to qualify and recover from errors, using Exceptions.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Hidde Beydals
  4. return base64_encode($signature);
  5. }
  6. throw new \InvalidArgumentException('Unable to sign the request, this has to do with the provided (invalid) private key.');
  7. }

Text files should end with a newline character 2

  • Info
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/missing_e_o_l

in doc/forward.md, line 44
  1. ````php
  2. // create Forward object with changed fields only
  3. $forward = new TransIP\Model\Forward('foo.com', 'http://foobar.com');
  4. $client->forward()->modify($forward);
  5. ````

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Hidde Beydals
in doc/webhosting.md, line 180
  1. ````php
  2. // SubDomain object to delete
  3. $subDomain = new TransIP\Model\SubDomain('bar');
  4. $client->hosting()->deleteSubDomain('foo.com', $subDomain);
  5. ````

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Hidde Beydals