CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

Update coding-standards version

Open paulbalandan opened this issue 3 years ago • 3 comments

Checklist:

  • [x] Securely signed commits
  • [ ] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [ ] Unit testing, with >80% coverage
  • [ ] User guide updated
  • [ ] Conforms to style guide

paulbalandan avatar Sep 13 '22 09:09 paulbalandan

It seems better to change the sample code.

    1) CodeIgniter4/user_guide_src/source/outgoing/response/018.php (date_time_create_from_format_call)
      ---------- begin diff ----------
--- /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/outgoing/response/018.php
+++ /home/runner/work/CodeIgniter4/CodeIgniter4/user_guide_src/source/outgoing/response/018.php
@@ -1,4 +1,4 @@
 <?php
 
-$date = DateTime::createFromFormat('j-M-Y', '15-Feb-2016');
+$date = DateTime::createFromFormat('!j-M-Y', '15-Feb-2016');
 $response->setDate($date);

      ----------- end diff -----------

kenjis avatar Sep 14 '22 00:09 kenjis

Yes I am in favor of updating the examples so they always match our coding standard; that was the primary reason behind splitting them out.

I wish there were a way to exempt 'U' from the ! rule; I think it is better to have it than dropping the rule, but it is a logical redundancy.

MGatner avatar Sep 15 '22 10:09 MGatner

@paulbalandan Could you make the parallel changes over at codeigniter4/devkit as well please?

MGatner avatar Sep 15 '22 10:09 MGatner

@paulbalandan Could you make the parallel changes over at codeigniter4/devkit as well please?

Done. https://github.com/codeigniter4/devkit/pull/47

paulbalandan avatar Sep 24 '22 15:09 paulbalandan