Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Traits

  • CookieTrait
  • HeaderTrait
  • ProtocolTrait
  • RequestHeaderTrait
  • RequestMethodTrait
  • ResponseHeaderTrait
  • StatusCodeTrait

Trait RequestMethodTrait

Provides a simple means for representing a request method as an object.

Traits provide extended method support to classes without requiring a direct, linear chain of inheritance. This allows functions to inherit subsets of related methods without declaring a parent class.

In Oroboros core, ALL methods are granted to classes via traits, and the classes themselves are just containers that correlate their methods to an interface they are expected to honor. This approach maximizes interoperability, by entirely removing class inheritance as a requirement for extension of any class in this system.

3rd parties using this package are not expected to follow this approach,

but ALL of our internal class and logic structure does.

Direct Known Users

oroboros\core\abstracts\utilities\http\AbstractRequestMethod

Indirect Known Users

oroboros\core\utilities\http\RequestMethod

Namespace: oroboros\core\traits\utilities\http
Package: oroboros\core\utilities
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version: 0.2.4
Since: 0.2.4-alpha
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Link: Specifies the standard HTTP request methods
Link: Specifies the HTTP PATCH request method
Located at core/traits/utilities/http/RequestMethodTrait.php

Methods summary

public
# __construct( string $method = 'GET' )

Instantiates an object representing a valid http request method.

Instantiates an object representing a valid http request method.

Parameters

$method
(optional) If provided, must be a valid http request method. Defaults to GET if not provided.

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid request method is passed
public string
# __toString( )

Hooks into native PHP string language constructs, and provides a string value to represent this object.

Hooks into native PHP string language constructs, and provides a string value to represent this object.

Returns

string
public static array
# valid( )

Returns an array of valid http request methods.

Returns an array of valid http request methods.

Returns

array
public static boolean
# isValid( string $method )

Returns a boolean determination as to whether the provided value is a valid http request method.

Returns a boolean determination as to whether the provided value is a valid http request method.

Parameters

$method

Returns

boolean
protected
# _initializeRequestMethod( string $method )

Initializes the request method object with the provided value.

Initializes the request method object with the provided value.

Parameters

$method

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid request method is passed
private
# _validateRequestMethod( string $method )

Validates the provided request method

Validates the provided request method

Parameters

$method

Throws

oroboros\core\utilities\exception\InvalidArgumentException
if an invalid request method is passed
private
# _setRequestMethod( $method )

Properties summary

private static array $_request_methods_valid

Represents the valid http request methods.

Represents the valid http request methods.

# array( 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'HEAD', 'CONNECT', 'PATCH' )
private string $_request_method

Represents the current request method.

Represents the current request method.

#
private boolean $_request_method_is_initialized

Represents whether the request method has been correctly initialized.

Represents whether the request method has been correctly initialized.

# false
Oroboros Core API documentation generated by ApiGen