Source code should not contain TODO comments 14

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/task_todo_comment

  1. throw new RuntimeException(
  2. 'Could not instanciate a database connection.'
  3. );
  4. }
  5. /** @todo Filter binds */

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. if (is_string($query)) {
  7. $this->logger->debug($query);
  8. $sth = $db->prepare($query);
  9. $sth->execute();
  10. } elseif (is_array($query)) {
  1. /**
  2. * Retrieve the model data as a flattened structure.
  3. *
  4. * This method returns a 1-dimensional array of the object's values.
  5. *
  6. * @todo Implementation required.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * @return array
  8. */
  9. public function flatData()
  10. {
  11. return [];
  1. /**
  2. * Alias of {@see self::values()}
  3. *
  4. * @deprecated
  5. * @todo Trigger deprecation error.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @return object[]
  7. */
  8. public function objects()
  9. {
  10. return $this->values();
  1. /**
  2. * Alias of {@see self::all()}.
  3. *
  4. * @deprecated
  5. * @todo Trigger deprecation error.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @return object[]
  7. */
  8. public function map()
  9. {
  10. return $this->all();
  1. }
  2. /**
  3. * Determine if an object exists by its key.
  4. *
  5. * @todo Needs implementation

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @param string $ident The object identifier to lookup.
  7. * @return boolean
  8. */
  9. public function __isset($ident)
  10. {
  1. // =============================================================================================
  2. /**
  3. * Determine if an object exists by its key.
  4. *
  5. * @todo Needs implementation

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @see ArrayAccess::offsetExists
  7. * @param string $ident The object identifier to lookup.
  8. * @return boolean
  9. */
  10. public function offsetExists($ident)
  1. }
  2. /**
  3. * Retrieve the WHERE condition.
  4. *
  5. * @todo Values are often not quoted.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @throws UnexpectedValueException If any required property, function, operator, or value is empty.
  7. * @return string
  8. */
  9. protected function byPredicate()
  10. {
  1. $key = $model->key();
  2. if ($key) {
  3. $query .= ', PRIMARY KEY (`'.$key.'`) '."\n";
  4. }
  5. /** @todo Add indexes for all defined list constraints (yea... tough job...) */

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. if ($driver === self::MYSQL_DRIVER_NAME) {
  7. $engine = 'InnoDB';
  8. $query .= ') ENGINE='.$engine.' DEFAULT CHARSET=utf8 COMMENT="'.addslashes($metadata['name']).'";';
  9. } else {
  10. $query .= ');';
  1. }
  2. /**
  3. * Retrieve all fields from a model.
  4. *
  5. * @todo Move this method in StorableTrait or AbstractModel

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @param ModelInterface $model The model to get fields from.
  7. * @param array|null $properties Optional list of properties to get.
  8. * If NULL, retrieve all (from metadata).
  9. * @return PropertyField[]
  10. */
  1. $dbh = $this->db();
  2. $this->logger->debug($query);
  3. $sth = $dbh->prepare($query);
  4. // @todo Binds

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by beneroch
  5. if (!empty($binds)) {
  6. unset($binds);
  7. }
  8. $sth->execute();
  1. * @return mixed The created item ID, otherwise FALSE.
  2. */
  3. public function saveItem(StorableInterface $item)
  4. {
  5. if ($this->tableExists() === false) {
  6. /** @todo Optionnally turn off for some models */

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. $this->createTable();
  8. }
  9. if ($item !== null) {
  10. $this->setModel($item);
  1. }
  2. /**
  3. * Compile the WHERE clause.
  4. *
  5. * @todo [2016-02-19] Use bindings for filters value

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @return string
  7. */
  8. public function sqlFilters()
  9. {
  10. if (!$this->hasFilters()) {
  1. }
  2. /**
  3. * Retrieve the model property's field names.
  4. *
  5. * @todo Load Property from associated model metadata.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @return array
  7. */
  8. public function fieldNames()
  9. {
  10. if ($this->hasProperty()) {
  1. }
  2. /**
  3. * Set the object's datasource repository.
  4. *
  5. * @todo This method needs to be protected.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @param SourceInterface $source The storable object's source.
  7. * @return self
  8. */
  9. public function setSource(SourceInterface $source)
  10. {