original_string: public function findById(int $id)
      {
          $entity = null;
  
          for ($i = 0; $i < count($this->registries); $i++) {
              /** @var RegistryInterface $registry */
              $registry = $this->registries[ $i ];
              $entity = $registry->findByKey($id);
  
              if ($entity instanceof AbstractEntity) {
                  $this->updateRegistries([$entity], $i - 1);
                  break;
              }
          }
  
          return $entity;
      }
code: public function findById(int $id)
      {
          $entity = null;
  
          for ($i = 0; $i < count($this->registries); $i++) {
              /** @var RegistryInterface $registry */
              $registry = $this->registries[ $i ];
              $entity = $registry->findByKey($id);
  
              if ($entity instanceof AbstractEntity) {
                  $this->updateRegistries([$entity], $i - 1);
                  break;
              }
          }
  
          return $entity;
      }
code_tokens: public function findById ( int $ id ) { $ entity = null ; for ( $ i = 0 ; $ i < count ( $ this -> registries ) ; $ i ++ ) { /** @var RegistryInterface $registry */ $ registry = $ this -> registries [ $ i ] ; $ entity = $ registry -> findByKey ( $ id ) ; if ( $ entity instanceof AbstractEntity ) { $ this -> updateRegistries ( [ $ entity ] , $ i - 1 ) ; break ; } } return $ entity ; }
docstring: Finds an entity by its id
  
  @param int $id
  
  @return AbstractEntity|null
docstring_tokens: Finds an entity by its id