junichi11 commented on code in PR #8227:
URL: https://github.com/apache/netbeans/pull/8227#discussion_r1956962337


##########
php/php.editor/src/org/netbeans/modules/php/editor/typinghooks/PhpTypedBreakInterceptor.java:
##########
@@ -182,9 +184,11 @@ public void insert(MutableContext context) throws 
BadLocationException {
                 }
                 sb.append(IndentUtils.createIndentString(doc, indent));
             } else {
-                LexUtilities.findPreviousToken(ts, 
Arrays.asList(PHPTokenId.PHP_CURLY_OPEN));

Review Comment:
   There is a bug here:
   e.g.
   ```php
   class C { // expected curly brace
       public function test() { // but found this brace
       }
   ^} // caret position
   ```
   Instead, find a correct brace via the new method (`findCurlyOpenOffset()`).
   



##########
php/php.editor/test/unit/data/testfiles/formatting/php84/propertyHooks_01.php.testPropertyHookDeclarationBP_01c.formatted:
##########
@@ -0,0 +1,544 @@
+<?php
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+class PropertyHooksClass {
+
+    public $valid01 {
+        get
+            {
+            return $this->prop1;
+            }
+        set
+            {
+            $this->valid01 = $value;
+            }
+    }
+    public int $valid02 = 1 {
+        get
+            {
+            echo __METHOD__, "\n";
+            return $this->valid02;
+            }
+        set($value)
+            {
+            $this->valid02 = $value;
+            }
+    }
+    public $valid03 = "string" {
+        get
+            {
+            return $this->valid03;
+            }
+        set {}
+    }
+    public string $valid04 = self::CONSTANT {
+        get => $this->valid04;
+        set {}
+    }
+    public array $valid05 = [] {
+        get => $this->valid05;
+        set => $this->valid05 = $value;
+    }
+    public private(set) string $valid06 = self::CONSTANT {
+        get
+            {
+            return $this->valid06 . "test";
+            }
+        set {}
+    }
+    public $valid07 { // virtual
+        get => $this->test();
+        set => $this->test() . $value;
+    }
+    public string $valid08 {
+        set(string|array $param)
+            {
+            $this->valid08 = is_array($param) ? join(', ', $param) : $param;
+            }
+    }
+    public $valid09 {
+        #[Arri1] get {}
+        #[Attr2] set {}
+    }
+    public $valid10 = 100 {
+        get
+            {
+            yield 1;
+            yield $this->valid10;
+            yield 3;
+            }
+    }
+    public $valid11 { // virtual
+        get
+            {
+            yield 1;
+            yield 2;
+            yield 3;
+            }
+    }
+    public $valid12 {
+        set(#[SensitiveParameter] $value)
+            {
+            throw new Exception('test');
+            }
+    }
+    public $valid13 {
+        final get
+            {
+            return 100;
+        }

Review Comment:
   This is an existing bug. I didn't fix it (maybe, the priority is very low) 
because I don't think the `New Line Indented` option is important.
   
   We can also reproduce this using a method.
   
   ```php
   class C {
       public function example() { return 100;}
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to