Skip to content
Snippets Groups Projects

Add PHP 7 type annotation to Product/Price classes

1 unresolved thread

Last one! This PR adds type annotations for the Product and Price services.

Please review: @ahoffmann @weizhong-wang @lloyd-carter @KJOYNER

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
119 116 * @param string $name
120 117 * @return Product
121 118 */
122 public function setName($name)
119 public function setName(string $name): Product
123 120 {
124 121 $this->name = $name;
125 122 return $this;
126 123 }
127 124
128 125 /**
129 * @return Money
126 * @return Money|null
130 127 */
131 128 public function getCost()
  • This has been an interesting exercise. We've been passing the wrong datatypes to some of these things for a while, but everything has been working as expected! If nothing else, I'll appreciate the piece of mind knowing that we're giving CBS what it expects now that our IDEs will complain a bit more.

  • merged

  • Andy Summers mentioned in commit e2d28789

    mentioned in commit e2d28789

  • Please register or sign in to reply
    Loading