chris-kruining/utilities

View on GitHub
src/Common/Exceptions/MethodNotAvailable.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace CPB\Utilities\Common\Exceptions
{
    class MethodNotAvailable extends \BadMethodCallException
    {
        public function __construct(string $class, string $method)
        {
            $trace = $this->getTrace();
            
            parent::__construct(\sprintf(
                '\'%s::%s\' is neither a macro\'ed method nor accessible or does not exist',
                $class,
                $method
            ));
            
            $this->file = $trace[0]['file'];
            $this->line = $trace[0]['line'];
        }
    }
}