original_string: private function buildArguments(string $class, array $dependency): array
      {
          //initialize arguments array
          $args = [];
  
          //argument required from class
          foreach ($dependency as $argValue) {
              if (\class_exists((string) $argValue->getType())) {
                  //add to array of arguments
                  $paramClass = $argValue->getClass()->name;
                  $args[] = $this->cache[$paramClass];
                  continue;
              }
  
              $args[] = null;
          }
  
          //check if there is rules for this class
          if (isset($this->rules[$class])) {
              //merge arguments
              $args = \array_replace($args, $this->rules[$class]);
          }
  
          return $args;
      }
code: private function buildArguments(string $class, array $dependency): array
      {
          //initialize arguments array
          $args = [];
  
          //argument required from class
          foreach ($dependency as $argValue) {
              if (\class_exists((string) $argValue->getType())) {
                  //add to array of arguments
                  $paramClass = $argValue->getClass()->name;
                  $args[] = $this->cache[$paramClass];
                  continue;
              }
  
              $args[] = null;
          }
  
          //check if there is rules for this class
          if (isset($this->rules[$class])) {
              //merge arguments
              $args = \array_replace($args, $this->rules[$class]);
          }
  
          return $args;
      }
code_tokens: private function buildArguments ( string $ class , array $ dependency ) : array { //initialize arguments array $ args = [ ] ; //argument required from class foreach ( $ dependency as $ argValue ) { if ( \ class_exists ( ( string ) $ argValue -> getType ( ) ) ) { //add to array of arguments $ paramClass = $ argValue -> getClass ( ) -> name ; $ args [ ] = $ this -> cache [ $ paramClass ] ; continue ; } $ args [ ] = null ; } //check if there is rules for this class if ( isset ( $ this -> rules [ $ class ] ) ) { //merge arguments $ args = \ array_replace ( $ args , $ this -> rules [ $ class ] ) ; } return $ args ; }
docstring: Build dependency for a object.
  
  @param string $class
  @param array  $dependency
  
  @return array
docstring_tokens: Build dependency for a object .