code: public function getResource($resource) : ?string
      {
          Preconditions::checkState($this->isPsr0Compatible(), "Class '%s' must be PSR-0 compatible!", $this->getName());
          $slashedFileName = $this->getSlashedFileName();
          $filePath = $resource[0] == '/'
              ? str_replace("/{$this->getSlashedName()}.php", '', $slashedFileName) . $resource
              : dirname($slashedFileName) . '/' . $resource;
          return is_file($filePath) ? $filePath : null;
      }
docs: Get a file name depending on current class.
  
  Suppose the class is \foo\Bar which located in src/foo/Bar.php
  Absolute path: /resources/res1 must be located in src/resources/res1
  Relative path: resources/res2 must be located in src/foo/resources/res2
  
  @param string $resource
  @return string File path of $resource or null if not exists
  @see java.lang.Class
  @throws RuntimeException Class is built-int
  @throws IllegalStateException Class is not PSR-0 compatible