original_string: public function isPublished( $now = null )
      {
          if ( ! $this->published )
          {
              return false;
          }
  
          if ( empty( $now ) )
          {
              $now = new DateTime();
          }
          else
          {
              $now = $this->inputDate( $now );
          }
  
          if ( ! empty( $this->publishedTo ) &&
               ! $this->publishedTo->diff( $now )->invert )
          {
              return false;
          }
  
          if ( ! empty( $this->publishedFrom ) &&
               $this->publishedFrom->diff( $now )->invert )
          {
              return false;
          }
  
          return true;
      }
code: public function isPublished( $now = null )
      {
          if ( ! $this->published )
          {
              return false;
          }
  
          if ( empty( $now ) )
          {
              $now = new DateTime();
          }
          else
          {
              $now = $this->inputDate( $now );
          }
  
          if ( ! empty( $this->publishedTo ) &&
               ! $this->publishedTo->diff( $now )->invert )
          {
              return false;
          }
  
          if ( ! empty( $this->publishedFrom ) &&
               $this->publishedFrom->diff( $now )->invert )
          {
              return false;
          }
  
          return true;
      }
code_tokens: public function isPublished ( $ now = null ) { if ( ! $ this -> published ) { return false ; } if ( empty ( $ now ) ) { $ now = new DateTime ( ) ; } else { $ now = $ this -> inputDate ( $ now ) ; } if ( ! empty ( $ this -> publishedTo ) && ! $ this -> publishedTo -> diff ( $ now ) -> invert ) { return false ; } if ( ! empty ( $ this -> publishedFrom ) && $ this -> publishedFrom -> diff ( $ now ) -> invert ) { return false ; } return true ; }
docstring: Is published at a given time point
  
  @param int|string|\DateTime $now default: null
  @return bool
docstring_tokens: Is published at a given time point