lib/Ajde/Social/Provider/Twitter/OAuth.php

Summary

Maintainability
D
2 days
Test Coverage

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_headers accesses the super-global variable $_ENV.
Open

    public static function get_headers()
    {
        if (function_exists('apache_request_headers')) {
            // we need this to get the actual Authorization: header
            // because apache tends to tell us it doesn't exist

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

from_request accesses the super-global variable $_SERVER.
Open

    public static function from_request($http_method = null, $http_url = null, $parameters = null)
    {
        $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
            ? 'http'
            : 'https';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_headers accesses the super-global variable $_SERVER.
Open

    public static function get_headers()
    {
        if (function_exists('apache_request_headers')) {
            // we need this to get the actual Authorization: header
            // because apache tends to tell us it doesn't exist

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_headers accesses the super-global variable $_ENV.
Open

    public static function get_headers()
    {
        if (function_exists('apache_request_headers')) {
            // we need this to get the actual Authorization: header
            // because apache tends to tell us it doesn't exist

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_headers accesses the super-global variable $_SERVER.
Open

    public static function get_headers()
    {
        if (function_exists('apache_request_headers')) {
            // we need this to get the actual Authorization: header
            // because apache tends to tell us it doesn't exist

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_headers accesses the super-global variable $_SERVER.
Open

    public static function get_headers()
    {
        if (function_exists('apache_request_headers')) {
            // we need this to get the actual Authorization: header
            // because apache tends to tell us it doesn't exist

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File OAuth.php has 591 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

// vim: foldmethod=marker

/* Generic exception class
Severity: Major
Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 1 day to fix

    Function get_headers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function get_headers()
        {
            if (function_exists('apache_request_headers')) {
                // we need this to get the actual Authorization: header
                // because apache tends to tell us it doesn't exist
    Severity: Minor
    Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method get_headers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function get_headers()
        {
            if (function_exists('apache_request_headers')) {
                // we need this to get the actual Authorization: header
                // because apache tends to tell us it doesn't exist
    Severity: Minor
    Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 1 hr to fix

      Method from_request has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function from_request($http_method = null, $http_url = null, $parameters = null)
          {
              $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                  ? 'http'
                  : 'https';
      Severity: Minor
      Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 1 hr to fix

        Function parse_parameters has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function parse_parameters($input)
            {
                if (!isset($input) || !$input) {
                    return [];
                }
        Severity: Minor
        Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 55 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function to_header has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function to_header($realm = null)
            {
                $first = true;
                if ($realm) {
                    $out = 'Authorization: OAuth realm="'.OAuthUtil::urlencode_rfc3986($realm).'"';
        Severity: Minor
        Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function build_http_query has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function build_http_query($params)
            {
                if (!$params) {
                    return '';
                }
        Severity: Minor
        Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method from_consumer_and_token has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
        Severity: Minor
        Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 35 mins to fix

          Function from_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';
          Severity: Minor
          Found in lib/Ajde/Social/Provider/Twitter/OAuth.php - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Remove error control operator '@' on line 295.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Remove error control operator '@' on line 274.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Remove error control operator '@' on line 259.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '674', column '23').
          Open

                      throw new OAuthException('Invalid consumer');

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 703.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '730', column '23').
          Open

                      throw new OAuthException(

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '669', column '23').
          Open

                      throw new OAuthException('Invalid consumer key');

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 427.
          Open

              public function get_normalized_http_url()
              {
                  $parts = parse_url($this->http_url);
          
                  $port = @$parts['port'];

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '481', column '27').
          Open

                          throw new OAuthException('Arrays not supported in headers');

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 685.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          The method set_parameter has a boolean flag argument $allow_duplicates, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public function set_parameter($name, $value, $allow_duplicates = true)

          BooleanArgumentFlag

          Since: 1.4.0

          A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

          Example

          class Foo {
              public function bar($flag = true) {
              }
          }

          Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

          Missing class import via use statement (line '763', column '23').
          Open

                      throw new OAuthException("Nonce already used: $nonce");

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 306.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Remove error control operator '@' on line 322.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '750', column '23').
          Open

                      throw new OAuthException(

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 424.
          Open

              public function get_normalized_http_url()
              {
                  $parts = parse_url($this->http_url);
          
                  $port = @$parts['port'];

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '690', column '23').
          Open

                      throw new OAuthException("Invalid $token_type token: $token_field");

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 279.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Remove error control operator '@' on line 641.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '720', column '23').
          Open

                      throw new OAuthException('Invalid signature');

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 667.
          Open

              private function get_consumer(&$request)
              {
                  $consumer_key = @$request->get_parameter('oauth_consumer_key');
                  if (!$consumer_key) {
                      throw new OAuthException('Invalid consumer key');

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '646', column '23').
          Open

                      throw new OAuthException('No signature method parameter. This parameter is required');

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          The method split_header has a boolean flag argument $only_allow_oauth_parameters, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)

          BooleanArgumentFlag

          Since: 1.4.0

          A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

          Example

          class Foo {
              public function bar($flag = true) {
              }
          }

          Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

          Missing class import via use statement (line '629', column '23').
          Open

                      throw new OAuthException("OAuth version '$version' not supported");

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Remove error control operator '@' on line 704.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          ErrorControlOperator

          Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

          Example

          function foo($filePath) {
              $file = @fopen($filPath); // hides exceptions
              $key = @$array[$notExistingKey]; // assigns null to $key
          }

          Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

          Missing class import via use statement (line '652', column '23').
          Open

                      throw new OAuthException(

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '738', column '23').
          Open

                      throw new OAuthException(

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Avoid using static access to class 'OAuthUtil' in method 'build_signature'.
          Open

                  $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'build_signature'.
          Open

                  $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'to_string'.
          Open

                  OAuthUtil::urlencode_rfc3986($this->secret);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'to_string'.
          Open

                  OAuthUtil::urlencode_rfc3986($this->key).

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'get_signable_parameters'.
          Open

                  return OAuthUtil::build_http_query($params);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'to_header'.
          Open

                      $out = 'Authorization: OAuth realm="'.OAuthUtil::urlencode_rfc3986($realm).'"';

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'from_request'.
          Open

                      $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'from_request'.
          Open

                      $request_headers = OAuthUtil::get_headers();

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'from_request'.
          Open

                          $post_data = OAuthUtil::parse_parameters(
                              file_get_contents(self::$POST_INPUT)
                          );

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method get_headers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      // otherwise we don't have apache and are just going to have to hope
                      // that $_SERVER actually contains what we need
                      $out = [];
                      if (isset($_SERVER['CONTENT_TYPE'])) {

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          The method build_http_query uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          $pairs[] = $parameter.'='.$value;
                      }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          The method parse_parameters uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          $parsed_parameters[$parameter] = $value;
                      }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'OAuthUtil' in method 'get_signature_base_string'.
          Open

                  $parts = OAuthUtil::urlencode_rfc3986($parts);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method 'from_request'.
          Open

                          $header_parameters = OAuthUtil::split_header(
                              $request_headers['Authorization']
                          );

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid using static access to class 'OAuthUtil' in method '__construct'.
          Open

                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method set_parameter uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $this->parameters[$name] = $value;
                  }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'OAuthUtil' in method 'to_header'.
          Open

                      $out .= OAuthUtil::urlencode_rfc3986($k).

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method urlencode_rfc3986 uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      if (is_scalar($input)) {
                          return str_replace(
                              '+',
                              ' ',

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'OAuthUtil' in method 'to_header'.
          Open

                          OAuthUtil::urlencode_rfc3986($v).

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          The method to_header uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $out = 'Authorization: OAuth';
                  }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          The method urlencode_rfc3986 uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                      } else {
                          return '';
                      }

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          Avoid using static access to class 'OAuthUtil' in method 'to_postdata'.
          Open

                  return OAuthUtil::build_http_query($this->parameters);

          StaticAccess

          Since: 1.4.0

          Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

          Example

          class Foo
          {
              public function bar()
              {
                  Bar::baz();
              }
          }

          Source https://phpmd.org/rules/cleancode.html#staticaccess

          Avoid unused local variables such as '$ok'.
          Open

                  $ok = openssl_sign($base_string, $signature, $privatekeyid);

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused parameters such as '$callback'.
          Open

              public function new_request_token($consumer, $callback = null)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$nonce'.
          Open

              public function lookup_nonce($consumer, $token, $nonce, $timestamp)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$consumer'.
          Open

              public function new_access_token($token, $consumer, $verifier = null)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused local variables such as '$total'.
          Open

                  $total = [];

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused parameters such as '$token'.
          Open

              public function lookup_token($consumer, $token_type, $token)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$timestamp'.
          Open

              public function lookup_nonce($consumer, $token, $nonce, $timestamp)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$token'.
          Open

              public function new_access_token($token, $consumer, $verifier = null)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$token_type'.
          Open

              public function lookup_token($consumer, $token_type, $token)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$verifier'.
          Open

              public function new_access_token($token, $consumer, $verifier = null)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$consumer_key'.
          Open

              public function lookup_consumer($consumer_key)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$consumer'.
          Open

              public function lookup_token($consumer, $token_type, $token)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$token'.
          Open

              public function lookup_nonce($consumer, $token, $nonce, $timestamp)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$consumer'.
          Open

              public function lookup_nonce($consumer, $token, $nonce, $timestamp)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid unused parameters such as '$consumer'.
          Open

              public function new_request_token($consumer, $callback = null)

          UnusedFormalParameter

          Since: 0.2

          Avoid passing parameters to methods or constructors and then not using those parameters.

          Example

          class Foo
          {
              private function bar($howdy)
              {
                  // $howdy is not used
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

          Avoid excessively long variable names like $only_allow_oauth_parameters. Keep variable name length under 20.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          The parameter $callback_url is not named in camelCase.
          Open

              public function __construct($key, $secret, $callback_url = null)
              {
                  $this->key = $key;
                  $this->secret = $secret;
                  $this->callback_url = $callback_url;

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The property $http_url is not named in camelCase.
          Open

          class OAuthRequest
          {
              private $parameters;
              private $http_method;
              private $http_url;

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The class OAuthSignatureMethod_PLAINTEXT is not named in CamelCase.
          Open

          class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod
          {
              public function get_name()
              {
                  return 'PLAINTEXT';

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The property $POST_INPUT is not named in camelCase.
          Open

          class OAuthRequest
          {
              private $parameters;
              private $http_method;
              private $http_url;

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          Avoid variables with short names like $ok. Configured minimum length is 3.
          Open

                  $ok = openssl_sign($base_string, $signature, $privatekeyid);

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          The property $http_method is not named in camelCase.
          Open

          class OAuthRequest
          {
              private $parameters;
              private $http_method;
              private $http_url;

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The class OAuthSignatureMethod_HMAC_SHA1 is not named in CamelCase.
          Open

          class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod
          {
              public function get_name()
              {
                  return 'HMAC-SHA1';

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The class OAuthSignatureMethod_RSA_SHA1 is not named in CamelCase.
          Open

          abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod
          {
              public function get_name()
              {
                  return 'RSA-SHA1';

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The parameter $http_url is not named in camelCase.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          Avoid variables with short names like $ok. Configured minimum length is 3.
          Open

                  $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          The property $base_string is not named in camelCase.
          Open

          class OAuthRequest
          {
              private $parameters;
              private $http_method;
              private $http_url;

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The parameter $http_method is not named in camelCase.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $http_url is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The property $signature_methods is not named in camelCase.
          Open

          class OAuthServer
          {
              protected $timestamp_threshold = 300; // in seconds, five minutes
              protected $version = '1.0';             // hi blaine
              protected $signature_methods = [];

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The parameter $only_allow_oauth_parameters is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $http_method is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $http_method is not named in camelCase.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $allow_duplicates is not named in camelCase.
          Open

              public function set_parameter($name, $value, $allow_duplicates = true)
              {
                  if ($allow_duplicates && isset($this->parameters[$name])) {
                      // We have already added parameter(s) with this name, so add to the list
                      if (is_scalar($this->parameters[$name])) {

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $signature_method is not named in camelCase.
          Open

              public function build_signature($signature_method, $consumer, $token)
              {
                  $signature = $signature_method->build_signature($this, $consumer, $token);
          
                  return $signature;

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $token_type is not named in camelCase.
          Open

              public function lookup_token($consumer, $token_type, $token)
              {
                  // implement me
              }

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          Avoid variables with short names like $mt. Configured minimum length is 3.
          Open

                  $mt = microtime();

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#shortvariable

          The parameter $signature_method is not named in camelCase.
          Open

              public function add_signature_method($signature_method)
              {
                  $this->signature_methods[$signature_method->get_name()] =
                      $signature_method;
              }

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $http_url is not named in camelCase.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $signature_method is not named in camelCase.
          Open

              public function sign_request($signature_method, $consumer, $token)
              {
                  $this->set_parameter(
                      'oauth_signature_method',
                      $signature_method->get_name(),

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $data_store is not named in camelCase.
          Open

              public function __construct($data_store)
              {
                  $this->data_store = $data_store;
              }

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The property $timestamp_threshold is not named in camelCase.
          Open

          class OAuthServer
          {
              protected $timestamp_threshold = 300; // in seconds, five minutes
              protected $version = '1.0';             // hi blaine
              protected $signature_methods = [];

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $data_store is not named in camelCase.
          Open

          class OAuthServer
          {
              protected $timestamp_threshold = 300; // in seconds, five minutes
              protected $version = '1.0';             // hi blaine
              protected $signature_methods = [];

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The parameter $consumer_key is not named in camelCase.
          Open

              public function lookup_consumer($consumer_key)
              {
                  // implement me
              }

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The parameter $token_type is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseParameterName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name parameters.

          Example

          class ClassName {
              public function doSomething($user_name) {
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $key_parts = [
                      $consumer->secret,
                      ($token) ? $token->secret : '',

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $decoded_sig is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $decoded_sig = base64_decode($signature);
          
                  $base_string = $request->get_signature_base_string();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $callback_url is not named in camelCase.
          Open

              public function __construct($key, $secret, $callback_url = null)
              {
                  $this->key = $key;
                  $this->secret = $secret;
                  $this->callback_url = $callback_url;

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $key_parts = [
                      $consumer->secret,
                      ($token) ? $token->secret : '',

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $key_parts = [
                      $consumer->secret,
                      ($token) ? $token->secret : '',

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public function __construct($http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $parameters = array_merge(OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
                  $this->parameters = $parameters;

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $decoded_sig is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $decoded_sig = base64_decode($signature);
          
                  $base_string = $request->get_signature_base_string();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $key_parts = [
                      $consumer->secret,
                      ($token) ? $token->secret : '',

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $request_headers is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_parameters is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              public function build_signature($signature_method, $consumer, $token)
              {
                  $signature = $signature_method->build_signature($this, $consumer, $token);
          
                  return $signature;

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $token_field is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $duplicate_value is not named in camelCase.
          Open

              public static function build_http_query($params)
              {
                  if (!$params) {
                      return '';
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              public function sign_request($signature_method, $consumer, $token)
              {
                  $this->set_parameter(
                      'oauth_signature_method',
                      $signature_method->get_name(),

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_name is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $request_headers is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $data_store is not named in camelCase.
          Open

              public function __construct($data_store)
              {
                  $this->data_store = $data_store;
              }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $consumer_key is not named in camelCase.
          Open

              private function get_consumer(&$request)
              {
                  $consumer_key = @$request->get_parameter('oauth_consumer_key');
                  if (!$consumer_key) {
                      throw new OAuthException('Invalid consumer key');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_content is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_token is not named in camelCase.
          Open

              public function fetch_access_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $token_type is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_name is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $post_data is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $duplicate_value is not named in camelCase.
          Open

              public static function build_http_query($params)
              {
                  if (!$params) {
                      return '';
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_token is not named in camelCase.
          Open

              public function fetch_request_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              public function sign_request($signature_method, $consumer, $token)
              {
                  $this->set_parameter(
                      'oauth_signature_method',
                      $signature_method->get_name(),

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $decoded_sig = base64_decode($signature);
          
                  $base_string = $request->get_signature_base_string();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $base_string is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $decoded_sig = base64_decode($signature);
          
                  $base_string = $request->get_signature_base_string();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $post_data is not named in camelCase.
          Open

              public function to_url()
              {
                  $post_data = $this->to_postdata();
                  $out = $this->get_normalized_http_url();
                  if ($post_data) {

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_token is not named in camelCase.
          Open

              public function fetch_request_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $consumer_key is not named in camelCase.
          Open

              private function get_consumer(&$request)
              {
                  $consumer_key = @$request->get_parameter('oauth_consumer_key');
                  if (!$consumer_key) {
                      throw new OAuthException('Invalid consumer key');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_token is not named in camelCase.
          Open

              public function fetch_access_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $request_headers is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $valid_sig is not named in camelCase.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $valid_sig is not named in camelCase.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $key_parts is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $token_field is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_method is not named in camelCase.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $http_url is not named in camelCase.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $post_data is not named in camelCase.
          Open

              public function to_url()
              {
                  $post_data = $this->to_postdata();
                  $out = $this->get_normalized_http_url();
                  if ($post_data) {

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $post_data is not named in camelCase.
          Open

              public function to_url()
              {
                  $post_data = $this->to_postdata();
                  $out = $this->get_normalized_http_url();
                  if ($post_data) {

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              public function add_signature_method($signature_method)
              {
                  $this->signature_methods[$signature_method->get_name()] =
                      $signature_method;
              }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $post_data is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $consumer_key is not named in camelCase.
          Open

              private function get_consumer(&$request)
              {
                  $consumer_key = @$request->get_parameter('oauth_consumer_key');
                  if (!$consumer_key) {
                      throw new OAuthException('Invalid consumer key');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $request_headers is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              public function add_signature_method($signature_method)
              {
                  $this->signature_methods[$signature_method->get_name()] =
                      $signature_method;
              }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $allow_duplicates is not named in camelCase.
          Open

              public function set_parameter($name, $value, $allow_duplicates = true)
              {
                  if ($allow_duplicates && isset($this->parameters[$name])) {
                      // We have already added parameter(s) with this name, so add to the list
                      if (is_scalar($this->parameters[$name])) {

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $token_field is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_content is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $only_allow_oauth_parameters is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $token_type is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_parameters is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $signature_method is not named in camelCase.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parsed_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $header_name is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The method to_string is not named in camelCase.
          Open

              public function to_string()
              {
                  return 'oauth_token='.
                  OAuthUtil::urlencode_rfc3986($this->key).
                  '&oauth_token_secret='.

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_name is not named in camelCase.
          Open

              public function get_name()
              {
                  return 'PLAINTEXT';
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_name is not named in camelCase.
          Open

              abstract public function get_name();

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method check_signature is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $decoded_sig = base64_decode($signature);
          
                  $base_string = $request->get_signature_base_string();

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_name is not named in camelCase.
          Open

              public function get_name()
              {
                  return 'HMAC-SHA1';
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_name is not named in camelCase.
          Open

              public function get_name()
              {
                  return 'RSA-SHA1';
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_signature is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method check_signature is not named in camelCase.
          Open

              public function check_signature($request, $consumer, $token, $signature)
              {
                  $built = $this->build_signature($request, $consumer, $token);
          
                  return $built == $signature;

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method fetch_private_cert is not named in camelCase.
          Open

              abstract protected function fetch_private_cert(&$request);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_signature is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $base_string = $request->get_signature_base_string();
                  $request->base_string = $base_string;
          
          

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_signature is not named in camelCase.
          Open

              abstract public function build_signature($request, $consumer, $token);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method fetch_public_cert is not named in camelCase.
          Open

              abstract protected function fetch_public_cert(&$request);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_normalized_http_method is not named in camelCase.
          Open

              public function get_normalized_http_method()
              {
                  return strtoupper($this->http_method);
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method urlencode_rfc3986 is not named in camelCase.
          Open

              public static function urlencode_rfc3986($input)
              {
                  if (is_array($input)) {
                      return array_map(['OAuthUtil', 'urlencode_rfc3986'], $input);
                  } else {

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method to_header is not named in camelCase.
          Open

              public function to_header($realm = null)
              {
                  $first = true;
                  if ($realm) {
                      $out = 'Authorization: OAuth realm="'.OAuthUtil::urlencode_rfc3986($realm).'"';

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_version is not named in camelCase.
          Open

              private function get_version(&$request)
              {
                  $version = $request->get_parameter('oauth_version');
                  if (!$version) {
                      // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_parameter is not named in camelCase.
          Open

              public function get_parameter($name)
              {
                  return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_parameters is not named in camelCase.
          Open

              public function get_parameters()
              {
                  return $this->parameters;
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method lookup_consumer is not named in camelCase.
          Open

              public function lookup_consumer($consumer_key)
              {
                  // implement me
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method split_header is not named in camelCase.
          Open

              public static function split_header($header, $only_allow_oauth_parameters = true)
              {
                  $pattern = '/(([-_a-z]*)=("([^"]*)"|([^,]*)),?)/';
                  $offset = 0;
                  $params = [];

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_headers is not named in camelCase.
          Open

              public static function get_headers()
              {
                  if (function_exists('apache_request_headers')) {
                      // we need this to get the actual Authorization: header
                      // because apache tends to tell us it doesn't exist

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method generate_nonce is not named in camelCase.
          Open

              private static function generate_nonce()
              {
                  $mt = microtime();
                  $rand = mt_rand();
          
          

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_signature is not named in camelCase.
          Open

              public function build_signature($request, $consumer, $token)
              {
                  $key_parts = [
                      $consumer->secret,
                      ($token) ? $token->secret : '',

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method lookup_token is not named in camelCase.
          Open

              public function lookup_token($consumer, $token_type, $token)
              {
                  // implement me
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method new_access_token is not named in camelCase.
          Open

              public function new_access_token($token, $consumer, $verifier = null)
              {
                  // return a new access token attached to this consumer
                  // for the user associated with this token if the request token
                  // is authorized

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method set_parameter is not named in camelCase.
          Open

              public function set_parameter($name, $value, $allow_duplicates = true)
              {
                  if ($allow_duplicates && isset($this->parameters[$name])) {
                      // We have already added parameter(s) with this name, so add to the list
                      if (is_scalar($this->parameters[$name])) {

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_signature is not named in camelCase.
          Open

              public function build_signature($signature_method, $consumer, $token)
              {
                  $signature = $signature_method->build_signature($this, $consumer, $token);
          
                  return $signature;

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method from_consumer_and_token is not named in camelCase.
          Open

              public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = null)
              {
                  @$parameters or $parameters = [];
                  $defaults = [
                      'oauth_version'      => self::$version,

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_signature_base_string is not named in camelCase.
          Open

              public function get_signature_base_string()
              {
                  $parts = [
                      $this->get_normalized_http_method(),
                      $this->get_normalized_http_url(),

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method check_timestamp is not named in camelCase.
          Open

              private function check_timestamp($timestamp)
              {
                  if (!$timestamp) {
                      throw new OAuthException(
                          'Missing timestamp parameter. The parameter is required'

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method unset_parameter is not named in camelCase.
          Open

              public function unset_parameter($name)
              {
                  unset($this->parameters[$name]);
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_signable_parameters is not named in camelCase.
          Open

              public function get_signable_parameters()
              {
                  // Grab all parameters
                  $params = $this->parameters;
          
          

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method check_signature is not named in camelCase.
          Open

              private function check_signature(&$request, $consumer, $token)
              {
                  // this should probably be in a different method
                  $timestamp = @$request->get_parameter('oauth_timestamp');
                  $nonce = @$request->get_parameter('oauth_nonce');

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method lookup_nonce is not named in camelCase.
          Open

              public function lookup_nonce($consumer, $token, $nonce, $timestamp)
              {
                  // implement me
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_normalized_http_url is not named in camelCase.
          Open

              public function get_normalized_http_url()
              {
                  $parts = parse_url($this->http_url);
          
                  $port = @$parts['port'];

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method sign_request is not named in camelCase.
          Open

              public function sign_request($signature_method, $consumer, $token)
              {
                  $this->set_parameter(
                      'oauth_signature_method',
                      $signature_method->get_name(),

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method fetch_request_token is not named in camelCase.
          Open

              public function fetch_request_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method to_url is not named in camelCase.
          Open

              public function to_url()
              {
                  $post_data = $this->to_postdata();
                  $out = $this->get_normalized_http_url();
                  if ($post_data) {

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method fetch_access_token is not named in camelCase.
          Open

              public function fetch_access_token(&$request)
              {
                  $this->get_version($request);
          
                  $consumer = $this->get_consumer($request);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method from_request is not named in camelCase.
          Open

              public static function from_request($http_method = null, $http_url = null, $parameters = null)
              {
                  $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on')
                      ? 'http'
                      : 'https';

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method to_postdata is not named in camelCase.
          Open

              public function to_postdata()
              {
                  return OAuthUtil::build_http_query($this->parameters);
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method generate_timestamp is not named in camelCase.
          Open

              private static function generate_timestamp()
              {
                  return time();
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method verify_request is not named in camelCase.
          Open

              public function verify_request(&$request)
              {
                  $this->get_version($request);
                  $consumer = $this->get_consumer($request);
                  $token = $this->get_token($request, $consumer, 'access');

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_signature_method is not named in camelCase.
          Open

              private function get_signature_method(&$request)
              {
                  $signature_method =
                      @$request->get_parameter('oauth_signature_method');
          
          

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method add_signature_method is not named in camelCase.
          Open

              public function add_signature_method($signature_method)
              {
                  $this->signature_methods[$signature_method->get_name()] =
                      $signature_method;
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method new_request_token is not named in camelCase.
          Open

              public function new_request_token($consumer, $callback = null)
              {
                  // return a new token attached to this consumer
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method parse_parameters is not named in camelCase.
          Open

              public static function parse_parameters($input)
              {
                  if (!isset($input) || !$input) {
                      return [];
                  }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_consumer is not named in camelCase.
          Open

              private function get_consumer(&$request)
              {
                  $consumer_key = @$request->get_parameter('oauth_consumer_key');
                  if (!$consumer_key) {
                      throw new OAuthException('Invalid consumer key');

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_token is not named in camelCase.
          Open

              private function get_token(&$request, $consumer, $token_type = 'access')
              {
                  $token_field = @$request->get_parameter('oauth_token');
                  $token = $this->data_store->lookup_token(
                      $consumer, $token_type, $token_field

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method check_nonce is not named in camelCase.
          Open

              private function check_nonce($consumer, $token, $nonce, $timestamp)
              {
                  if (!$nonce) {
                      throw new OAuthException(
                          'Missing nonce parameter. The parameter is required'

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method urldecode_rfc3986 is not named in camelCase.
          Open

              public static function urldecode_rfc3986($string)
              {
                  return urldecode($string);
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method build_http_query is not named in camelCase.
          Open

              public static function build_http_query($params)
              {
                  if (!$params) {
                      return '';
                  }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          There are no issues that match your filters.

          Category
          Status