File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 44
55use DateTime ;
66use FiveamCode \LaravelNotionApi \Entities \PropertyItems \RichDate ;
7+ use Illuminate \Support \Arr ;
78
89/**
910 * Class Formula
@@ -20,12 +21,12 @@ protected function fillFromRaw(): void
2021 {
2122 parent ::fillFromRaw ();
2223
23- if (array_key_exists ( ' type ' , $ this ->rawContent )) {
24+ if (Arr:: exists ( $ this ->rawContent , ' type ' )) {
2425 $ this ->formulaType = $ this ->rawContent ['type ' ];
2526
26- if ($ this ->formulaType == 'string ' || $ this ->formulaType == 'number ' || $ this ->formulaType == 'boolean ' ) {
27+ if ($ this ->formulaType === 'string ' || $ this ->formulaType === 'number ' || $ this ->formulaType = == 'boolean ' ) {
2728 $ this ->content = $ this ->rawContent [$ this ->formulaType ];
28- } else if ($ this ->formulaType == 'date ' ) {
29+ } else if ($ this ->formulaType === 'date ' ) {
2930 $ this ->content = new RichDate ();
3031 if (isset ($ this ->rawContent [$ this ->formulaType ]['start ' ])) $ this ->content ->setStart (new DateTime ($ this ->rawContent [$ this ->formulaType ]['start ' ]));
3132 if (isset ($ this ->rawContent [$ this ->formulaType ]['end ' ])) $ this ->content ->setEnd (new DateTime ($ this ->rawContent [$ this ->formulaType ]['end ' ]));
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ protected function fillFromRaw(): void
2020 parent ::fillFromRaw ();
2121
2222 try {
23- if ($ this ->rawContent != null ) {
23+ if ($ this ->rawContent !== null ) {
2424 $ this ->content = new DateTime ($ this ->rawContent );
2525 }
2626 } catch (Exception $ e ) {
Original file line number Diff line number Diff line change 55use FiveamCode \LaravelNotionApi \Entities \Contracts \Modifiable ;
66use FiveamCode \LaravelNotionApi \Entities \PropertyItems \SelectItem ;
77use FiveamCode \LaravelNotionApi \Exceptions \HandlingException ;
8+ use Illuminate \Support \Arr ;
89use Illuminate \Support \Collection ;
910
1011/**
@@ -56,7 +57,7 @@ protected function fillFromRaw(): void
5657
5758 $ itemCollection = new Collection ();
5859
59- if (array_key_exists ( ' options ' , $ this ->rawContent )){
60+ if (Arr:: exists ( $ this ->rawContent , ' options ' )){
6061 $ this ->options = new Collection ();
6162 foreach ($ this ->rawContent ['options ' ] as $ key => $ item ) {
6263 $ this ->options ->add (new SelectItem ($ item ));
Original file line number Diff line number Diff line change 55use DateTime ;
66use FiveamCode \LaravelNotionApi \Entities \PropertyItems \RichDate ;
77use FiveamCode \LaravelNotionApi \Exceptions \HandlingException ;
8+ use Illuminate \Support \Arr ;
89use Illuminate \Support \Collection ;
910
1011/**
@@ -22,7 +23,7 @@ protected function fillFromRaw(): void
2223 {
2324 parent ::fillFromRaw ();
2425
25- if (array_key_exists ( ' type ' , $ this ->rawContent ))
26+ if (Arr:: exists ( $ this ->rawContent , ' type ' ))
2627 {
2728 $ this ->rollupType = $ this ->rawContent ['type ' ];
2829
You can’t perform that action at this time.
0 commit comments