original_string: public function findBySelector( $selector, $media = '', $rootId = null )
      {
          $rootId = ( (int) $rootId ) ?: null;
          $rule   = $this->getMapper()
                         ->findBySelector( $selector, $media, $rootId );
  
          if ( empty( $rule ) )
          {
              $rule = $this->getMapper()
                           ->create( array(
                               'media'            => $media,
                               'selector'         => $selector,
                               'rootParagraphId'  => $rootId,
                           ) );
          }
  
          return $rule;
      }
code: public function findBySelector( $selector, $media = '', $rootId = null )
      {
          $rootId = ( (int) $rootId ) ?: null;
          $rule   = $this->getMapper()
                         ->findBySelector( $selector, $media, $rootId );
  
          if ( empty( $rule ) )
          {
              $rule = $this->getMapper()
                           ->create( array(
                               'media'            => $media,
                               'selector'         => $selector,
                               'rootParagraphId'  => $rootId,
                           ) );
          }
  
          return $rule;
      }
code_tokens: public function findBySelector ( $ selector , $ media = '' , $ rootId = null ) { $ rootId = ( ( int ) $ rootId ) ? : null ; $ rule = $ this -> getMapper ( ) -> findBySelector ( $ selector , $ media , $ rootId ) ; if ( empty ( $ rule ) ) { $ rule = $ this -> getMapper ( ) -> create ( array ( 'media' => $ media , 'selector' => $ selector , 'rootParagraphId' => $ rootId , ) ) ; } return $ rule ; }
docstring: Get rule by selector & media
  
  @param string $selector
  @param string $media [optional]
  @param null|int $rootId [optional]
  @return \Customize\Model\Rule\Structure
docstring_tokens: Get rule by selector & media